package it.traveldream.dto;

import java.math.BigDecimal;

import org.hibernate.validator.constraints.NotEmpty;

public class TransportMeanDTO extends ProductDTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private int spaces;
	private BigDecimal price;
	@NotEmpty
	private String meanType;
	
	private DepartureDTO departure;
	public int getSpaces() {
		return this.spaces;
	}
	public void setSpaces(int spaces) {
		this.spaces = spaces;
	}
	public BigDecimal getPrice() {
		return this.price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public String getMeanType() {
		return this.meanType;
	}
	public void setMeanType(String meanType) {
		this.meanType = meanType;
	}
	public DepartureDTO getDeparture() {
		return this.departure;
	}
	public void setDeparture(DepartureDTO departure) {
		this.departure = departure;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.departure == null) ? 0 : this.departure.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof TransportMeanDTO))
			return false;
		TransportMeanDTO other = (TransportMeanDTO) obj;
		if (other.getProductId().equals(this.getProductId()))
			return true;
		return false;
	}
}
